package com.typhoon.spring_boot_demo1.controller;

import com.typhoon.spring_boot_demo1.bean.User;
import com.typhoon.spring_boot_demo1.manager.UserManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserManager userManager;

    @RequestMapping("user/get/{id}")
    public User queryUser(@PathVariable("id") Long id) {
        User user = this.userManager.queryById(id);
        return user;
    }
}
